﻿using System;
using System.Xml.Serialization;

namespace PSE.Deployment.SetupBase.Configuration
{
    [Serializable]
    public class WindowsService
    {
		bool _isRunning = false;

        [XmlAttribute()]
        public string ServiceName { get; set; }
        
        [XmlAttribute()]
        public string DisplayName { get; set; }
        
        [XmlAttribute()]
        public string Description { get; set; }

        public FileInfo ServiceFile { get; set; }

        public FileInfo ConfigFile { get; set; }
        
        [XmlAttribute()]
        public bool Start { get; set; }
        
        [XmlAttribute()]
        public string[] InitialArgs { get; set; }
		
        [XmlAttribute()]
		public bool IsRunning
		{
			get { return _isRunning; }
			set
			{
				if (value != _isRunning)
                    HasChanges = true;

				_isRunning = value;
			}
		}

        [XmlAttribute()]
        public bool HasChanges { get; set; }

        public WindowsService()
        { 
            ServiceFile = new FileInfo();
            ConfigFile = new FileInfo();
        }
    }
} 